<!--{{#extends @html/layouts/layout-standart.html}}-->
{{#extends @feed.html}}
<!--
    lucky@jetstyle.ru о шаблонных переменных:

    member - владелец этой странички
    user   - пользователь, просмаривающий эту страницу
-->

{{:title}}Поиск{{/:title}}

<!-- действия -->
{{:init}}
	{{@feed.html:init}}
	{{!connect "screen/member.css" media="screen" charset="utf-8"}}
{{/:init}}

{{:layout_right}}
{{@html/widgets/tags.html}}
{{/:layout_right}}

{{:content_class}}content-posts{{/:content_class}}

{{:layout_main}}
{{!connect "screen/search.css"}}
{{!connect "screen/content-posts.css"}}
{{!connect "screen/content-posts-comments.css"}}

<!-- ========================= Установки для работы js ============== -->
<!-- для imageswitcher.js -->
{{@html/config/imageswitcher.html}}

<!-- a href="{{ajax_url}}" id="feed_url"></a>
<a href="{{items_remaining}}" id="items_remaining"></a -->
<!-- ========================= Установки для работы js ============== -->



			


			<!-- status -->
			{{?member.status}}<div class="status-">{{member.status}}</div>{{/?}}
			<!-- content -->
			<h1 class="title-">
				Поиск
				{{?tag_sections.selected}}
				<!-- раздел, раздел => тег -->
				{{?current_tag}} по теме &laquo;{{current_tag.name}}&raquo; {{/?}}
				{{?:tdi_title}}
				<!-- разделы не выбраны -->
				<!-- тег -->
				{{tdi_title}}
				{{/?}}
			</h1>
			<!-- search form -->

				<form action="{{/}}{{?aa.community_url}}{{aa.community_url}}/{{/?}}{{?aa.tdi_url}}{{aa.tdi_url}}/{{/?}}search" method="get" id="search_form" class="search-form">
					<input type="hidden" name="lpage" value="1" />
					<input type="text" name="sstring" value="{{sstring_encode}}" class="query-" />
					<input type="image" src="{{!static type='images' 'button-search-page.gif'}}" alt="Найти" class="submit-" />
					<fieldset class="fieldset-"><input type="radio" id="sogs" name="search_options" value="global_search"{{? global_search || "global_search" == search_options}} checked="checked"{{/?}} class="radio-" /> <label for="sogs" class="label-">по всему тексту</label></fieldset>
					<fieldset class="fieldset-"><input type="radio" id="sous" name="search_options" value="user_search"{{? user_search}} checked="checked"{{/?}} class="radio-" /> <label for="sous" class="label-">по пользователям</label></fieldset>
					<fieldset class="fieldset-"><input type="radio" id="sots" name="search_options" value="title_search"{{? title_search}} checked="checked"{{/?}} class="radio-" /> <label for="sots" class="label-">в названии</label></fieldset>

					{{?tags}}
					<input type="hidden" name="tags" value="{{!for tags do=@:tags_in_form}}" />
					{{:tags_in_form}}{{*title}}{{?!For.last}},{{/?}}{{/:tags_in_form}}
					{{/?}}
				</form>

				{{?tags}}
				<div class="search-tags">
					Тематика записей:
					{{!for tags do=@:tags_under_form}}
						{{:tags_under_form}}<a href="?tag={{*title|escape type='url'}}&sstring={{sstring|escape type='url'}}" title="Выбрать все записи с меткой &laquo;{{*title}}&raquo;">{{*title}}</a>{{?!For.last}},{{/?}}{{/:tags_under_form}}
						<a href="javascript: cleanSearchTags();" class="drop-">сбросить фильтр</a>
						<script class="text/javascript">
							function cleanSearchTags() {
								jQuery("#search_form").get(0).tags.value = "";
								jQuery("#search_form").submit();
							}
						</script>
				</div>
				{{/?}}

			<!-- about -->
			<div class="list-" id="itemslist">
				<div id="search_content">
				{{?not_found}}
				<div class="content cb"><p>Ничего не найдено.</p></div>
				{{?:}}
					{{?items}}
						{{!for items do=@:blogitemblock}}
					{{/?}}
					{{?user_items}}
						{{!for user_items do=@:useritemblock}}
					{{/?}}
				{{/?}}
				</div>
        		<div id="search_content_end"></div>
			</div>
			<ul class="pagenavigation-">
				{{?prev_page}}
				<li><a href="{{/}}{{?aa.community_url}}{{aa.community_url}}/{{/?}}{{?aa.tdi_url}}{{aa.tdi_url}}/{{/?}}search?sstring={{sstring_encode}}&search_options={{search_options}}&lpage={{prev_page}}">← Следующая страница</a></li>
				{{?:}}
				<li>← Следующая страница</li>
				{{/?}}
				{{?next_page}}
				<li><a href="{{/}}{{?aa.community_url}}{{aa.community_url}}/{{/?}}{{?aa.tdi_url}}{{aa.tdi_url}}/{{/?}}search?sstring={{sstring_encode}}&search_options={{search_options}}&lpage={{next_page}}">Предыдущая страница →</a></li>
				{{?:}}
				<li>Предыдущая страница →</li>
				{{/?}}
			</ul>

				<script type="text/javascript" language="Javascript">
          function setSearchOption( optionName ) {
            var field = jQuery("#search_form input[name=search_options]").get(0);
            
            if ( field ) {
              field.value = optionName;
            }
            
            var field = jQuery("#top_search_form input[name=search_options]").get(0);
            
            if ( field ) {
              field.value = optionName;
            }
          }
				</script>
		
		<!-- {{@feed.html:layout_pager}} -->


{{/:layout_main}}

{{:blogitemblock}}
<div class="item- js-post" id="i{{*post.oid}}">
	<!-- issue -->
	{{@:author author=*post.poster}}
	{{!doctype @html/doctypes/feed/__DOCTYPE__.html *post.type}}
	<!-- {{@:feed_item type=*post.type}} -->
	{{?*tags}}
	<ul class="tags-">
		<li class="hdr-">Тематика записи:</li>
		{{!for *tags do=@:item_tag}}
		{{:item_tag *is_current}}<li>{{*title}}{{?!For.last}},{{/?}}</li>{{/:item_tag}}
		{{:item_tag}}<li><a href="?tag={{*title|escape type='url'}}&sstring={{sstring_encode|escape type='url'}}" title="Выбрать все записи с меткой &laquo;{{*title}}&raquo;">{{*title}}</a>{{?!For.last}},{{/?}}</li>{{/:item_tag}}
	</ul>
	{{/?}}

	<!-- блок комментов (добавьте во внешний тег class="js-post" и id="i{{post_oid}}") -->
	{{@html/comments/comments.html:main item=*}}
</div>
{{/:blogitemblock}}

{{:useritemblock}}

<div class="item- item-user-" id="i{{*oid}}">
	<a href="{{?aa.community_url}}/{{aa.community_url}}{{/?}}/members/{{*oid}}" class="avatar-"><img src="{{?*avatar}}{{/}}{{!link_to *avatar 'imagestorage' 'sm1'}}{{?:}}{{images}}avatar-48x48.png{{/?}}" class="img-" /></a>
	<a href="{{?aa.community_url}}/{{aa.community_url}}{{/?}}/members/{{*oid}}" class="name-">{{*fullname}}</a>
	<span class="openid-">{{*openid_url}}</span>
</div>
{{/:useritemblock}}
